//
//  AroundController.m
//  youthNote
//
//  Created by huangrensheng on 15/12/29.
//  Copyright © 2015年 laber. All rights reserved.
//

#import "AroundController.h"
#import "AroundDetailController.h"
#import "AroundCell.h"

@interface AroundController ()<UITableViewDataSource,UITableViewDelegate>
@property (nonatomic, strong) UITableView *aroundTable;

@end

@implementation AroundController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor =[UIColor whiteColor];
    [self createWithLeftStyle:nil middleStyle:@{@"type":@"title",@"title":@"资讯"} rightStyle:nil];
    
    self.aroundTable = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
    self.aroundTable.separatorStyle = UITableViewCellSeparatorStyleNone;
    self.aroundTable.delegate = self;
    self.aroundTable.dataSource = self;
    [self.view addSubview:self.aroundTable];
    [self.aroundTable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.view);
    }];
//    NSError *error;
//    NSString *textFileContents = [NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"jpqn" ofType:@"txt"] encoding:NSUTF8StringEncoding error:&error];
//    [textFileContents stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
//    [textFileContents stringByReplacingOccurrencesOfString: @"\r\n" withString:@""];
//    NSLog(@"%@",textFileContents);
  
    
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 10;
}


- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    return 90;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    static NSString *identifer = @"AroundCell";	
    AroundCell *cell = [tableView dequeueReusableCellWithIdentifier:identifer];
    if (!cell) {
        cell = [[AroundCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifer];
    }
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(nonnull NSIndexPath *)indexPath{
    AroundDetailController *detail = [[AroundDetailController alloc] init];
    detail.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:detail animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
